exports.path = '/example/callAnon';
exports.title = '调用plsql匿名块范例';
exports.pool = 'task';

exports.sqltext = `
begin
  select count(*) into :taskCountDay
  from tf_mbss_tasks
  where CREATE_TIME > trunc(sysdate, 'day');

  select count(*) into :taskCountMonth
  from tf_mbss_tasks
  where CREATE_TIME > trunc(sysdate, 'month');

  select count(*) into :taskCountYear
  from tf_mbss_tasks
  where CREATE_TIME > trunc(sysdate, 'year');
end;
`;

exports.bindObj = {
  taskCountDay: {
    dir: oracledb.BIND_OUT,
    type: oracledb.NUMBER,
  },
  taskCountMonth: {
    dir: oracledb.BIND_OUT,
    type: oracledb.NUMBER,
  },
  taskCountYear: {
    dir: oracledb.BIND_OUT,
    type: oracledb.NUMBER,
  },
};

exports.request = {};

exports.outConverter = sqlresult => sqlresult.outBinds;
